package com.gzhryc.shared_device.common.payment.dao.db;

import com.gzhryc.common.NumberTools;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.DateBranchTable;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.jdbc.enums.DateBranchTableType;
import com.gzhryc.pay.enums.TradeType;
import com.gzhryc.pay.models.IPayOrder;
import com.gzhryc.shared_device.base.enums.EPayState;

import java.util.Date;

/**
 * 钱包支付订单
 * @version 2022-11-07
 */
@DateBranchTable(type = DateBranchTableType.year)
@Table(name="payment_wallet_pay_order")
public class WalletPayOrder implements IPayOrder {

    private static final long serialVersionUID = 1L;

	@Id(auto = false)
    @Column(name = "trade_no", length = 32,notNull = true, note = "支付订单号")
    protected String tradeNo;

    @Column
    protected String title;

    @Column(length = 255, note = "订单描述")
    protected String note;

    @Column(name = "business_type",notNull = true,  note = "业务类型")
    protected String businessType;

    @Column(name = "business_type_name",notNull = true,  note = "业务类型")
    protected String businessTypeName;

    @Column(name = "business_trade_no", length = 32, notNull = true, note = "业务订单号")
    protected String businessTradeNo;
    
    @Column(name = "payer_id", notNull = true, note = "支付者ID")
    protected String payerId;

    @Column(name = "pay_type", notNull = true, note = "支付类型")
    protected Integer payType;

    @Column(name = "trade_type", notNull = true,note = "订单类型，normal:普通订单，支付分订单")
    protected String tradeType;

    @Column(name = "pay_money", notNull = true,defVal = "0",note = "支付金额")
    protected Integer payMoney;

    @Column(name = "pay_date", note = "支付时间")
    protected Date payDate;

    @Column(name = "pay_status", notNull = true,defVal = "1",note = "支付状态")
    protected Integer payStatus;

    @Column(name = "fail_note", length = 255, note = "失败描述")
    protected String failNote;

    @Column(name = "update_date", note = "修改时间", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date", note = "创建时间")
    protected Date createDate;

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    public String getBusinessType() {
        return businessType;
    }

    public String getBusinessTypeName() {
        return businessTypeName;
    }

    public void setBusinessTypeName(String businessTypeName) {
        this.businessTypeName = businessTypeName;
    }

    public String getBusinessTradeNo() {
        return businessTradeNo;
    }

    public void setBusinessTradeNo(String businessTradeNo) {
        this.businessTradeNo = businessTradeNo;
    }

    public String getPayerId() {
		return payerId;
	}

	public void setPayerId(String payerId) {
		this.payerId = payerId;
	}

	public Integer getPayType() {
		return payType;
	}

	public void setPayType(Integer payType) {
		this.payType = payType;
	}

	public String getTradeType() {
        return tradeType;
    }

    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    public Integer getPayMoney() {
        return payMoney;
    }

    public void setPayMoney(Integer payMoney) {
        this.payMoney = payMoney;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public String getFailNote() {
        return failNote;
    }

    public void setFailNote(String failNote) {
        this.failNote = failNote;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getTradeTypeName(){
        return TradeType.note(this.tradeType);
    }

    public String getPayStatusName(){
        return EPayState.note(this.payStatus);
    }

    public String getPayMoneyStr(){
        return NumberTools.getMoneyStr(this.payMoney);
    }

	@Override
	public String getExternalTradeNo() {
		return null;
	}

	@Override
	public void setExternalTradeNo(String externalTradeNo) {
		
	}

}
